import Toast from '@vant/weapp/toast/toast';
import Ajax from "../../../../utils/ajax"
import Util from "../../../../utils/util"
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    radio:'1',
    showDate:false,
    date:'-',
    minDate: new Date().getTime(),
    maxDate: 2527171200000,
  },
  // attached(){
  //   // this.setData({
  //   //   date: this.formatDate(),
  //   // });

  // },

  /**
   * 组件的方法列表
   */

  methods: {
    onChange(e){ 
      this.setData({ radio:e.detail })
      app.globalData.ztPrice.payRentType = e.detail
    },
    formatDate(date) {
      date = date?new Date(date):new Date();
      return `${date.getFullYear() }年${date.getMonth() + 1}月${date.getDate()}日`;
    },
    onConfirm(event) {
      console.log(event.detail);
      var date = this.formatDate(event.detail);
      this.setData({
        showDate: false,
        date: date,
      });
      app.globalData.ztPrice.settledTime	= date;
    },
  }
})
